/**
 *  Exprezoo Records
 *  Copyright (C) 2012 Sergio De Mattia
 *  
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *  
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *  
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *  
 */
package com.sdmdev.android.exprezoorecords.activity;

import com.sdmdev.android.exprezoorecords.R;
import com.sdmdev.android.exprezoorecords.utility.ApplicationProperties;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;

public class InfoActivity extends Activity{

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.info);
		
		
		
        TextView developerTv = (TextView) findViewById(R.id.developerTxt);

        developerTv.setOnClickListener(new OnClickListener() {			

			public void onClick(View v) {
		        final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
		        /* Fill it with Data */
		        emailIntent.setType("plain/text");
		        emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{ApplicationProperties.EMAIL_DEVELOPER});
		        emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Subject");
		        emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Text");
		        /* Send it off to the Activity-Chooser */
		        InfoActivity.this.startActivity(Intent.createChooser(emailIntent, "Send mail..."));
			}
		});
		
	}
	

	public void onBackPressed() {
		finish();
		startActivity(new Intent(getApplicationContext(), HomePageActivity.class));
	}    
	
	@Override
	protected void onStop() {
		// TODO Auto-generated method stub
		super.onStop();
		finish();
	}
}
